package exam.AndroidFirst;

import android.app.Activity;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class Logo extends Activity implements AnimationListener{
	ImageView splash;
	ImageView background;
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.logo);
        
        /*
        Animation animation=new AlphaAnimation(0.0f, 1.0f);
        animation.setAnimationListener(new Animation.AnimationListener(){
        	public void onAnimationEnd(Animation arg0){
        		Handler handler=new Handler();
        		handler.postDelayed(new Runnable(){
        			public void run(){
        	            Intent i = new Intent(Logo.this,Main.class);
        	            startActivity(i);
        				Logo.this.finish();
        			}
        		},3000);
        	}
            public void onAnimationStart(Animation animation) {}
            public void onAnimationRepeat(Animation animation) {}
        });
        animation.setDuration(2000);
        splash=(ImageView)findViewById(R.id.splash);
        splash.startAnimation(animation);
        background=(ImageView)findViewById(R.id.splashBackground);
        background.setBackgroundColor(R.drawable.background);
        
        */
		Handler handler=new Handler();
		handler.postDelayed(new Runnable(){
			public void run(){
	            Intent i = new Intent(Logo.this,Main.class);
	            startActivity(i);
				Logo.this.finish();
			}
		},3000);
    }
	@Override
	public void onAttachedToWindow() {
		super.onAttachedToWindow();
		Window window = getWindow();
		window.setFormat(PixelFormat.RGBA_8888);
	}
	@Override
	public void onAnimationEnd(Animation animation) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onAnimationRepeat(Animation animation) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onAnimationStart(Animation animation) {
		// TODO Auto-generated method stub
		
	}
}
